package struts.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name="t_users")
@TableGenerator(
    name="userid_gen",
    table="Generator",
    pkColumnName = "key",
    valueColumnName = "id",
    pkColumnValue="user",
    allocationSize=1
)
public class User {
	private int id;
	private String name;
	private int age;
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE, generator="userid_gen")
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
}
